package thread;

public class Thread4 {
}

class MyThread4 extends Thread{
    public static void main(String[] args) {
        try {
            MyThread4 thread4=new MyThread4();
            thread4.start();
            Thread.sleep(200);
            thread4.interrupt();
        } catch (InterruptedException e) {
            System.out.println("main catch");
            e.printStackTrace();
        }
        System.out.println("end!");
    }


    @Override
    public void run() {
        try {
            System.out.println("run begin");
            Thread.sleep(20000);
            System.out.println("run end");
        } catch (InterruptedException e) {
            System.out.println("沉睡中被打醒!进入catch"+this.isInterrupted());
            e.printStackTrace();
        }
    }
}
